﻿#pragma strict


public var fond:Transform;
private var test:Transform;
public var menuPause:Transform;

function Start () {

}
		#if UNITY_EDITOR
		

		#else
		function OnApplicationPause()
		{
			if(Time.timeScale!=0)
			{
				Time.timeScale=0;
				extinctionBillet.perdu=true;
				extinctionBillet.fin=true;
				test=Transform.Instantiate(menuPause);
				test.localScale=fond.localScale;
			}
		}
		#endif

function OnMouseDown () {

		if(Time.timeScale!=0)
		{
			Time.timeScale=0;
			extinctionBillet.perdu=true;
			extinctionBillet.fin=true;
			test=Transform.Instantiate(menuPause);
			test.localScale=fond.localScale;
		}

}

function Update()
{
	if (Input.GetKeyDown(KeyCode.Escape)) 
	{ 
		if(Time.timeScale!=0)
		{
			Time.timeScale=0;
			extinctionBillet.perdu=true;
			extinctionBillet.fin=true;
			test=Transform.Instantiate(menuPause);
			test.localScale=fond.localScale;
		}
	}
}
